<!DOCTYPE html>
<html>
<head>
    <title>模具型芯备件采购批次信息</title>
    #parse("sys/header.html")
    <style>
        .sugon_upload_btn {
            display: -webkit-inline-box;
            display: inline-block;
        }
        ::-webkit-scrollbar{
            width: 10px;
            height: 10px;
        }
        ::-webkit-scrollbar-thumb{
            border-radius: 10px;
            -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
            background: #a8a5a5;
        }

    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.sparePartsName" @on-enter="query" placeholder="型芯名称"/>
                </i-col>
                <i-col span="4">
                    <i-input v-model="q.mapNo" @on-enter="query" placeholder="图号"/>
                </i-col>
                <i-col span="4">
                    <i-input v-model="q.supplier" @on-enter="query" placeholder="供应厂家"/>
                </i-col>
                <i-col span="4">
                    <i-input v-model="q.uniqueBarCode" @on-enter="query" placeholder="型芯条码代码"/>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row :gutter="16" style="margin: 3px 0px 0px 0px;">
            <div class="buttons-group">
                <Upload ref="uploadFile"
                        action="../modulesppurchasingbatch/import"
                        :format ="['xlsx','xls']"
                        :before-upload="handleBeforeUpload"
                        :show-upload-list="false"
                        :on-success="handleSuccess" :on-error="handleError"
                        :on-format-error="handleFormatError" class="sugon_upload_btn">
                    <i-button type="info"><i class="fa fa-hand-o-down"></i>&nbsp;导入</i-button>
                </Upload>
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
            </div>
        </Row>
        <table id="jqGrid"></table>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="moduleSpPurchasingBatch" :rules="ruleValidate" :label-width="80">
            <Row>
                <i-col span="11">
                    <Form-item label="备件名称" prop="moldSpName">
                        <i-input v-model="moduleSpPurchasingBatch.moldSpName" placeholder="备件名称" ref="moldSpNameInput" icon="md-arrow-dropdown-circle" @on-click="getSpareInfo" icon="md-arrow-dropdown-circle"  readonly/>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="图号" prop="mapNo">
                        <i-input v-model="moduleSpPurchasingBatch.mapNo" placeholder="图号" disabled/>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="供应厂家" prop="supplierName">
                        <i-input v-model="moduleSpPurchasingBatch.supplierName" placeholder="供应厂家" icon="md-arrow-dropdown-circle" @on-click="loadFacType" readonly icon="md-arrow-dropdown-circle" ></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="单价" prop="unitPrice">
                        <i-input v-model="moduleSpPurchasingBatch.unitPrice" placeholder="单价"/>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="适用月份">
                        <Date-picker type="month" placeholder="请选择开始月份" @on-change="handleChangeBeginMonth" :options="startMonthOptions" :editable="false"></Date-picker> -
                        <Date-picker type="month" placeholder="请选择结束月份" @on-change="handleChangeEndMonth" :options="endMonthOptions" :editable="false"></Date-picker>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="备注" prop="remark">
                        <i-input type="textarea" v-model="moduleSpPurchasingBatch.remark" placeholder="备注"/>
                    </Form-item>
                </i-col>
            </Row>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>
                返回</i-button>
                <i-button type="info" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>

<script src="${rc.contextPath}/js/module/modulesppurchasingbatch.js?_${date.systemTime}"></script>
</body>
</html>
